package com.zhiyin.seal.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhiyin.seal.entity.CompanyDepartmentEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

@Mapper
@Component
public interface CompanyDepartmentDao extends BaseMapper<CompanyDepartmentEntity> {

    Integer insertDepartment(@Param("companyDepartmentEntity") CompanyDepartmentEntity companyDepartmentEntity);

    CompanyDepartmentEntity getDepartmentById(@Param("id") Long id);

    List<CompanyDepartmentEntity> getDepartmentListByCompanyId(@Param("companyId")Long companyId);

    List<CompanyDepartmentEntity> getDepartmentListByDepartmentId(@Param("departmentId")Long departmentId);

    Integer updateDepartmentName(@Param("name") String name,@Param("id") Long id);

    Integer deleteDepartment(@Param("id") Long id);

    List<Long> selectSubDepartmentIds(@Param("departmentId") Long departmentId);

    List<Long> selectParentDepartmentIds(@Param("departmentId") Long departmentId);
}
